import React from 'react'
import PropTypes from 'prop-types'
import { Table, Avatar } from 'antd'
import config from 'config'
import AnimTableBody from 'components/DataTable/AnimTableBody'


const List = ({
  location,
  isMotion,
  ...tableProps
}) => {

  const columns = [
    {
      title: '微信号',
      dataIndex: 'wxId',
      key: 'wxId',
    },
    {
      title: '微信昵称',
      dataIndex: 'nickname',
      key: 'nickname',
    },
    {
      title: '权限',
      dataIndex: 'permission',
      key: 'permission'
    },
  ]

  const AnimateBody = (props) => {
    return <AnimTableBody {...props} />
  }

  const CommonBody = (props) => {
    return <tbody {...props} />
  }

  return (
    <Table
      {...tableProps}
      columns={columns}
      simple
      rowKey={record => record.id}
      components={{
        body: { wrapper: isMotion ? AnimateBody : CommonBody },
      }}
    />
  )
}

List.propTypes = {
  location: PropTypes.object
}

export default List
